<template>
  <div class="login">
    <label>
      <input v-model="account" type="text" placeholder="请输入账号">
    </label>
    <label>
      <input v-model="password" type="password" placeholder="请输入密码">
    </label>
    <button @click="loginIn">登录</button>
  </div>
</template>

<script>
  import { isEmpty } from '@/common/js/common'
  export default {
    name: 'Login',
    data() {
      return {
        isLogin: false, // 用户是否登录
        account: '', // 用户账号
        password: '', // 用户密码
      }
    },
    methods: {
      // 登录
      loginIn() {
        if (isEmpty(this.account)) {
          return alert("账户不能为空")
        }
        if (isEmpty(this.password)) {
          return alert("密码不能为空")
        }
        alert("登录成功")
        localStorage.setItem('Author', '4erwe6r4ew64r65we654r6w')
        this.$router.push({name: 'Home'})
      }
    },
    components: {}
  }
</script>

<style lang="scss">
  .login {

  }
</style>
